import {httpRequest} from '@/utils/http';

enum Api {
    startPlay = '/api/play/start/',
    broadcast = '/api/play/broadcast/',
    stopPlay = '/api/play/stop/'
}

/**
 * 开始播放video
 */
export function startPlay(deviceId: any, channelId: any) {
    return httpRequest.get({url: Api.startPlay + deviceId + '/' + channelId});
}

/**
 * 发起语音对讲
 * @param deviceId
 * @param channelId
 * @returns {*}
 */
export function broadcast(deviceId: any, channelId: any) {
    return httpRequest.get({url: Api.broadcast + deviceId + '/' + channelId + '?timeout=30&broadcastMode=false'});
}

/**
 * 停止播放
 * @param deviceId
 * @param channelId
 * @returns {*}
 */
export function stopPlay(deviceId: any, channelId: any) {
    return httpRequest.get({url: Api.stopPlay + deviceId + '/' + channelId});
}
